<script setup>
defineProps({
  title: String,
  alt: String,
  picture: String
})
</script>

<template>
  <div class="popular__item">
    <img class="popular__item__img" :src="picture" alt="" />
    <div class="popular__item__text1">{{ title }}</div>
    <div class="popular__item__text2">{{ alt }}</div>
  </div>
</template>

<style lang="scss" scoped>
.popular__item {
  width: 306px;
  height: 406px;
  background-color: #f0f9f4;
  transition: all 0.5s ease;
  .popular__item__img {
    width: 100%;
  }
  .popular__item__text1 {
    width: 246px;
    text-align: center;
    margin: 10px 0px;
    padding: 0px 30px;
    font-size: 22px;
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden; /* 隐藏溢出的内容 */
    text-overflow: ellipsis; /* 使用省略号替换溢出的文本 */
  }
  .popular__item__text2 {
    width: 100%;
    text-align: center;
    font-size: 18px;
    color: #888888;
  }
  &:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
  }
}
</style>
